import { OrgServiceApi, LogServiceApi } from "./_org";
import { AxiosResponse } from "axios";
import { objectToUrlParams } from "@/utils/common";
import service from "@/api";
import { SYSTEM_CONFIG } from "@/config/system";

class UnitTreeServiceApi extends OrgServiceApi {
  saveUnitAndSuperUnit(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/saveUnitAndSuperUnit";
    url += objectToUrlParams(params, true);
    return service.post(url, bean);
  }
  saveMultiDelete(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/saveMultiDelete";
    url += objectToUrlParams(params, true);
    return service.post(url, bean);
  }
  getUnitandParentUnits(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/getUnitandParentUnits";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
}
export const unitTreeServiceApi = new UnitTreeServiceApi("/UnitService");
